<?php



/**
 * Skeleton subclass for performing query and update operations on the 'view_bgf_with_superior_position_id' table.
 *
 *
 *
 * You should add additional methods to this class to meet the
 * application requirements.  This class will only be generated as
 * long as it does not already exist in the output directory.
 *
 * @package    propel.generator.empeval
 */
class EmpevalViewBgfWithSuperiorPositionIdQuery extends EmpevalBaseViewBgfWithSuperiorPositionIdQuery
{
	
	public function addAccessFilter() {
		$userPositionId = Empeval_Auth::getInstance()->getUser()->getUserPositionss()->getFirst()->getId();
		$this
			->joinUserPositionsRelatedByUserPositionId('UserPosition')
			->addCond('cond1', 'UserPosition.user_id', Empeval_Auth::getInstance()->getUser()->getId())
			->addCond('cond2', 'superior_user_position_id', $userPositionId)
			->combine(array('cond1', 'cond2'), Criteria::LOGICAL_OR);
		return $this;
	}
	
}
